#!/bin/bash
# Android ndk位置
ANDROID_NDK=/home/yfux/Downloads/android-ndk-r14b-linux-x86_64/android-ndk-r14b


function build_x264()
{

PREFIX=$(pwd)/android/$ANDROID_ABI
SYSROOT=$ANDROID_NDK/platforms/$ANDROID_API/$ANDROID_ARCH
TOOLCHAIN=$ANDROID_NDK/toolchains/$ANDROID_EABI/prebuilt/linux-x86_64/bin
CROSS_PREFIX=$TOOLCHAIN/$CROSS_COMPILE

echo "Compiling x264 for $ANDROID_ABI"

./configure \
--prefix=$PREFIX \
--disable-asm \
--enable-static \
--enable-shared \
--enable-pic \
--host=$HOST \
--cross-prefix=$CROSS_PREFIX \
--sysroot=$SYSROOT \
    
#make clean
#make -j12
#make install
#echo "The Compilation of x264 for $ANDROID_ABI is completed"}
# armeabi-v7aANDROID_ABI=armeabi-v7a

}
#ANDROID_ABI=armeabi-v7a
#ANDROID_API=android-24
#ANDROID_ARCH=arch-arm
#ANDROID_EABI=arm-linux-androideabi-4.9
#HOST=arm-linux-androideabi
#CROSS_COMPILE=arm-linux-androideabi-

#build_x264

# arm64-v8a
ANDROID_ABI=arm64-v8a
ANDROID_API=android-24
ANDROID_ARCH=arch-arm64
ANDROID_EABI=aarch64-linux-android-4.9
HOST=aarch64-linux-android
CROSS_COMPILE=aarch64-linux-android-

build_x264
